package com.yidu.user.utils;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;

/**
 * <p>Created with IntelliJ IDEA.</p>
 * <p>User: liandyao</p>
 * <p>Date: 2020-08-03</p>
 * <p>Time: 10:06</p>
 * <p>Description: 读取配置文件的类</p>
 */
@Component
@RefreshScope //实现热加载
public class YmlConfig {

    @Value("${spring.application.name}")
    private String name ;

    @Value("${eureka.instance.instance-id}")
    private String instanceId ;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getInstanceId() {
        return instanceId;
    }

    public void setInstanceId(String instanceId) {
        this.instanceId = instanceId;
    }
}
